package com.renli.controller;

import com.renli.bean.ResultJson;
import com.renli.pojo.Event;
import com.renli.pojo.PostRelease;
import com.renli.pojo.User;
import com.renli.service.TodolistService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Api(value = "代办列表接口", tags = "代办列表接口")
@ResponseBody
public class TodolistController {
    @Autowired
    TodolistService todolistService;

    @RequestMapping(value = "/selectTodolist", method = RequestMethod.POST)
    @ApiOperation(value = "遍历待办列表", notes = "遍历待办列表", httpMethod = "post", response = ResultJson.class)
    public ResultJson selectTodolist(@RequestBody @ApiParam(name = "User", value = "当前登录用户", required = true) User user) {

        return todolistService.selectTodolist(user);
    }

    @RequestMapping(value = "/handleTodolist", method = RequestMethod.POST)
    @ApiOperation(value = "处理待办列表", notes = "处理待办列表", httpMethod = "post", response = ResultJson.class)
    public ResultJson handleTodolist(@RequestBody @ApiParam(name = "event", value = "当前待办事件", required = true)Event event) {

        return todolistService.handleTodolist(event);
    }

    @RequestMapping(value = "/selectHandleTodolist", method = RequestMethod.POST)
    @ApiOperation(value = "查询待办列表详情", notes = "查询待办列表详情", httpMethod = "post", response = ResultJson.class)
    public ResultJson selectHandleTodolist(@RequestBody @ApiParam(name = "event", value = "当前待办事件", required = true)Event event) {

        return todolistService.selectHandleTodolist(event);
    }


}
